<%@page import="All.DTO.AccountBean"%>
<%@page import="All.utility.UserManagerProperties"%>
<%@page import="All.DTO.AccountDTO"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%
        AccountBean user = (AccountBean) session.getAttribute("UserBean");
	if ((user == null) || (!user.getRole().equals(UserManagerProperties.ADMIN_ROLE))) {
		response.sendRedirect("./DangNhap.jsp");
	}
	AccountDTO account = (AccountDTO) request.getAttribute("accountDTO");
%>
<!DOCTYPE html>
<html>
    <head>
        <title>User Info</title>
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="./css/style.css" />
        <!-- modernizr enables HTML5 elements and feature detects -->
        <script type="text/javascript" src="./js/modernizr-1.5.min.js"></script>
    </head>    
    <body>
        <div id="main">
            <header>
                <jsp:include page="./file/header.jsp"></jsp:include>
            </header>
            <div id="site_content">
                <jsp:include page="./file/LeftMenu.jsp"></jsp:include>
                <div class="content">
                    <form id="contact" action="./UpdateUserServlet" method="post">
                        <div class="form_settings">
                            <table width="50%">
                                <tr>
                                        <td colspan="2"><h1>User information</h1></td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>User name</td>
                                        <td>
                                                <input type="text" name="txtUsername" value="${accountDTO.username}">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Current password</td>
                                        <td>
                                                <input type="password" name="txtPass" value="<%=account.getPassword()%>">
                                        </td>
                                        <td>
                                </tr>
                                <tr>
                                        <td>First name</td>
                                        <td>
                                                <input type="text" name="txtHoten" value="<%=account.getHoten()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Date of birth</td>
                                        <td>
                                                <input type="text" name="txtNgaysinh" value="<%=account.getNgaysinh()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Sex</td>
                                        <td>
                                                <input type="text" name="txtGioitinh" value="<%=account.getGioitinh()%>" >
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Email</td>
                                        <td>
                                                <input type="text" name="txtEmail" value="<%=account.getEmail()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Mobile-phone</td>
                                        <td>
                                                <input type="text" name="txtDienthoai" value="<%=account.getDienthoai()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Date-join</td>
                                        <td>
                                                <input type="text" name="txtNgaythamgia" value="<%=account.getNgaythamgia()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Role</td>
                                        <td>
                                                <input type="text" name="txtRole" value="<%=account.getRole()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td></td>
                                        <td>
                                                <input type="button" value="Back" onclick="history.back();" class="submit">
                                                <input type="submit" value="Save" name="btnUpdate" class="submit">
                                        </td>
                                        <td></td>
                                </tr>
                        </table>
                        </div>
                    </form>
                </div>
            </div>           
            <footer>
                <jsp:include page="./file/footer.jsp"></jsp:include>
            </footer>
        </div>
        <p>&nbsp;</p>
  <!-- javascript at the bottom for fast page loading -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/jquery.easing-sooper.js"></script>
  <script type="text/javascript" src="./js/jquery.sooperfish.js"></script>
  <script type="text/javascript" src="./js/image_fade.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $('ul.sf-menu').sooperfish();
    });
  </script>
    </body>
</html>
